package edu.tjut.tjutcommunity.recommend.Main;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class ScheduledTasks {
    final
    JobSetter recSetter;

    public ScheduledTasks(JobSetter recSetter) {
        this.recSetter = recSetter;
    }

    @Scheduled(cron = "0 15 0 ? * *")
    public void recommend(){
        //为活跃用户执行推荐
        recSetter.executeInstantJobForActiveUsers();
    }
    //每小时执行一次分析今日热点
    @Scheduled(cron = "0 0 */1 * * ?")
    public void formTodayTopHotNewsList(){
        recSetter.formTodayTopHotNewsList();
    }
}
